package pattern.flyweight;

public class Test {
    public static void main(String[] args) {
        ITicket ticket = TicketFactory.getTicket("北京", "上海");
        ticket.show("二等座");
        ITicket ticket1 = TicketFactory.getTicket("北京", "上海");
        ticket1.show("商务座");
        ITicket ticket2 = TicketFactory.getTicket("上海", "北京");
        ticket2.show("一等座");
        System.out.println(ticket == ticket1);
        System.out.println(ticket == ticket2);
    }
}
